//
//  SystemMessageModel.m
//  bestkeep
//
//  Created by bj on 2016/11/17.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import "SystemMessageModel.h"

@implementation SystemMessageModel


- (void)setDetail:(NSString *)detail {
    _detail = detail;
     [self str:detail width:ScreenWidth - 75];
}

- (void)str:(NSString *)string width:(CGFloat)width {
    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
    NSRange allRange = [string rangeOfString:string];
    
    [attrStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14.0] range:allRange];
    
    [attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:allRange];
    
    NSStringDrawingOptions options =  NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading;
    
    CGRect rect = [attrStr boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:options context:nil];
    
    _height = rect.size.height;
    _a = (int)_height;
    _cellHeight = 110 + _a;
}


@end
